package itheima.com.Demo01.demo01.Map;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapTest02 {
    public static void main(String[] args) {
        Map<String,String> M=new HashMap<>();
        M.put("001号号","张一");
        M.put("002号号","张二");
        M.put("006号号","张三");
        M.put("004号号","张四");
        M.put("005号号","张五");





        Set<Map.Entry<String, String>> entries = M.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            String key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key+"-----------"+value);

        }


        method01(M);


    }

    private static void method01(Map<String, String> m) {
        Set<String> strings = m.keySet();
        for (String s : strings) {
            String s1 = m.get(s);
            System.out.println(s+"------"+s1);
//            System.out.println(s1);
        }
    }
}
